<template>
  <div class="inquiry-wrapper">
    <div class="inquiry-form">
      <div class="inquiry-tabs">
        <button
          class="tab-button active"
        >
          {{$t('contentDetails.priceInquiry')}}
        </button>
        <button
          class="tab-button"
          @click="navigateToTrack"
        >
          {{$t('contentDetails.track')}}
        </button>
      </div>

      <div class="form-content">
        <div class="service-info">
          <span class="service-text">{{$t('contentDetails.FTLEurope')}}</span>
        </div>

        <div class="transport-options">
          <button
            class="option-btn active"
            @click.prevent="$router.push('/quote');"
          >
            LTL/FTL
          </button>
          <button
            class="option-btn fcl-btn active"
            @click.prevent="$router.push('/quote');"
          >
            FCL
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script >
export default {
  props: {

  },
  computed: {

  },
  methods: {
    // 追踪跳转
    navigateToTrack() {
      this.$router.push('/tracking');
    }
  }
}
</script>

<style scoped lang="scss">
/* 询价表单独立样式 */
.inquiry-wrapper {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.inquiry-form {
  background: white;
  border-radius: 8px;
  padding: 20px 0;
  box-shadow: 0 4px 12px rgba(254, 50, 49, 0.2);
  overflow: hidden;
}

.inquiry-tabs {
  display: flex;
  margin-bottom: 40px;
  padding: 0 24px;
  justify-content: space-evenly;
}

.tab-button {
  flex: 0 1 auto;
  padding: 16px 24px;
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  position: relative;
  transition: all 0.3s ease;
  margin-right: 32px;

  &:hover {
    color: #fe3231;
  }
}

.tab-button:last-child {
  margin-right: 0;
}

.tab-button.active {
  color: #fe3231;
  font-weight: bold;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  width: calc(100% - 48px);
  height: 3px;
  background: #fe3231;
}

.form-content {
  padding: 0 24px 24px;
}

.service-info {
  text-align: center;
  margin-bottom: 40px;
}

.service-text {
  font-size: 16px;
  color: #333;
}

.location-fields {
  margin-bottom: 40px;
}

.field-group.combined {
  display: flex;
}

.field-group.combined input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #000;
  border-radius: 0;
  font-size: 16px;
  transition: all 0.3s ease;
}

.field-group.combined input:focus {
  outline: none;
  border-color: #fe3231;
  box-shadow: 0 0 0 2px rgba(254, 50, 49, 0.2);
  z-index: 1;
}

.transport-options {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.option-btn {
  padding: 20px 24px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
}

.option-btn.active {
  background: #fe3231;
  color: white;
  border-color: #fe3231;
}

.fcl-btn.active {
  border-color: #fe3231;
  color: #fe3231;
  background: white;
}

/* 媒体查询：为小屏幕设备添加移动端样式 */
@media (max-width: 768px) {
  .inquiry-wrapper {
    margin: 0px 0;
    padding: 0;
  }

  .inquiry-form {
    padding: 15px 0;
    border-radius: 0;
  }

  .inquiry-tabs {
    padding: 0 15px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* 允许标签在小屏幕上换行 */
  }

  .tab-button {
    padding: 12px 16px;
    font-size: 16px;
    margin-bottom: 10px; /* 添加底部外边距以便标签可以换行 */
    margin-right: 16px;

    &:last-child {
      margin-right: 16px;
    }

    &:hover {
      color: #fe3231;
    }
  }

  .tab-button.active::after {
    left: 16px;
    width: calc(100% - 32px);
  }

  .form-content {
    padding: 0 15px 15px;
  }

  .service-info {
    margin-bottom: 30px;
  }

  .service-text {
    font-size: 14px;
  }

  .location-fields {
    margin-bottom: 30px;
  }

  .field-group.combined input {
    padding: 12px 14px;
    font-size: 14px;
  }

  .transport-options {
    flex-direction: column; /* 在小屏幕上垂直排列按钮 */
    align-items: center;
  }

  .option-btn {
    width: 90%; /* 设置按钮宽度为屏幕的90% */
    padding: 16px 20px;
    margin-bottom: 10px; /* 添加底部外边距以分隔按钮 */
    font-size: 14px;
    min-width: auto; /* 取消最小宽度限制 */
  }
}

/* 媒体查询：为更小屏幕设备进一步优化样式 */
@media (max-width: 480px) {
  .inquiry-wrapper {
    margin: 0px 0;
  }

  .inquiry-tabs {
    padding: 0 10px;
  }

  .tab-button {
    padding: 10px 12px;
    font-size: 14px;
    margin-right: 10px;
  }

  .tab-button.active::after {
    left: 12px;
    width: calc(100% - 24px);
  }

  .service-text {
    font-size: 12px;
  }

  .field-group.combined input {
    padding: 10px 12px;
    font-size: 12px;
  }

  .option-btn {
    padding: 14px 16px;
    font-size: 12px;
  }
}
</style>
